<script src="jquery-1.10.1.min.js" type="text/javascript"></script>

<script type="text/javascript">

  jQuery(document).ready(function(){
    $('#copyId').on('click',function(){

      var val1 = $('#uname1Id').val();
      $('#uname2Id').val(val1);

    });// end click
  });//end ready

</script>

<span id="copyId">Copy</span>
<hr>

<input
type="text"
name="uname1"
id="uname1Id" />

<hr>

<input
type="text"
name="uname2"
id="uname2Id" />
